<?php

namespace App\Models\Shop;

use App\Models\BaseModel;

class ShopTypeModel extends BaseModel
{
    protected $table = 'shop_type';

    protected $primaryKey = 'id';

    public $dateFormat = 'U';

    public function attributes()
    {
        return $this->hasMany('App\Models\Shop\ShopAttributeModel','type_id','id');
    }

    public function specs()
    {
        return $this->hasMany('App\Models\Shop\ShopSpecModel','type_id','id');
    }

    public function getNames()
    {
        return ShopTypeModel::where('status',1)->pluck('name','id')->toArray();
    }
}
